<extend name="$_admin_public_layout"/>

<block name="full-header">
    <!-- 顶部导航 -->
    <div class="navbar navbar-default navbar-fixed-top main-nav" role="navigation">
        <div class="container-fluid">
            <div>
                <div class="navbar-header navbar-header-default">
                    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse-top">
                        <span class="sr-only">切换导航</span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                    <php>if(C('WEB_SITE_LOGO')):</php>
                        <a class="navbar-brand" href="__ROOT__/admin.php">
                            <img class="logo img-responsive" src="<?php echo get_cover(C('WEB_SITE_LOGO')); ?>">
                        </a>
                    <php>else:</php>
                        <a class="navbar-brand" href="__ROOT__/admin.php">
                            <span>{:C('LOGO_DEFAULT')}</span>
                        </a>
                    <php>endif;</php>
                    <!-- 一键切换后台模式 -->
                    <span class="hidden-xs btn btn-sm ajax-get pull-right m-t-sm m-r-xs" href="{:U('Admin/Config/toggle', array('name' => 'ADMIN_TABS'))}"><i class="fa fa-navicon" style="font-size: 15px;"></i></span>
                </div>
                <div class="navbar-header navbar-header-inverse">
                    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse-top">
                        <span class="sr-only">切换导航</span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                    <php>if(C('WEB_SITE_LOGO_INVERSE')):</php>
                        <a class="navbar-brand" href="__ROOT__/admin.php">
                            <img class="logo img-responsive" src="<?php echo get_cover(C('WEB_SITE_LOGO_INVERSE')); ?>">
                        </a>
                    <php>else:</php>
                        <a class="navbar-brand" href="__ROOT__/admin.php">
                            <span>{:C('LOGO_INVERSE')}</span>
                        </a>
                    <php>endif;</php>
                    <!-- 一键切换后台模式 -->
                    <span class="hidden-xs btn btn-sm ajax-get pull-right m-t-sm m-r-xs" href="{:U('Admin/Config/toggle', array('name' => 'ADMIN_TABS'))}"><i class="fa fa-navicon" style="font-size: 15px;"></i></span>
                </div>
                <div class="collapse navbar-collapse navbar-collapse-top">
                    <ul class="nav navbar-nav">
                        <!-- 主导航 -->
                        <?php if (!C('ADMIN_TABS')): ?>
                            <li><a href="{:U('Admin/Index/index')}"><i class="fa fa-home"></i> 首页</a></li>
                            <?php if (request()->isMobile()): ?>
                                <volist name="_menu_list" id="vo">
                                    <?php if(!($vo['is_dev'] && !C('DEVELOP_MODE'))): ?>
                                        <li class="dropdown <?php if($_parent_menu_list[0]['title'] == $vo['title']) echo 'active'; ?>">
                                            <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                                                <i class="fa {$vo.icon}"></i>
                                                <span>{$vo.title}</span>
                                                <b class="caret"></b>
                                            </a>
                                            <ul class="dropdown-menu" role="menu">
                                                <volist name="vo._child" id="_ns_first">
                                                    <?php if(!($_ns_first['is_dev'] && !C('DEVELOP_MODE'))): ?>
                                                        <li>
                                                            <a style="padding-left: 40px;" href="#">
                                                                <i class="{$_ns_first.icon}"></i>
                                                                <span class="nav-label">{$_ns_first.title}</span>
                                                            </a>
                                                        </li>
                                                        <notempty name="_ns_first._child">
                                                            <volist name="_ns_first._child" id="_ns_second">
                                                                <?php if(!($_ns_second['is_dev'] && !C('DEVELOP_MODE'))): ?>
                                                                    <li <?php if($_parent_menu_list[2]['url'] == $_ns_second['url']) echo 'class="active"'; ?>>
                                                                        <a style="padding-left: 60px;" href="{:U($_ns_second['url'])}" >
                                                                            <i class="{$_ns_second.icon}"></i>
                                                                            <span class="nav-label">{$_ns_second.title}</span>
                                                                        </a>
                                                                    </li>
                                                                <?php endif; ?>
                                                            </volist>
                                                        </notempty>
                                                    <?php endif; ?>
                                                </volist>
                                            </ul>
                                        </li>
                                    <?php endif; ?>
                                </volist>
                            <?php else: ?>
                                <?php if (count($_menu_list) > ($main_nav_limit-1)): ?>
                                    <volist name="_menu_list" id="vo" offset="0" length="$main_nav_limit-1">
                                        <?php if(!($vo['is_dev'] && !C('DEVELOP_MODE'))): ?>
                                            <li <?php if($_parent_menu_list[0]['title'] == $vo['title']) echo 'class="active"'; ?>>
                                                <a href="{:U($vo['_child'][0]['_child'][0]['url'])}" target="<php>echo C(strtolower($vo['name']).'_config.target');</php>">
                                                    <i class="fa {$vo.icon}"></i>
                                                    <span>{$vo.title}</span>
                                                </a>
                                            </li>
                                        <?php endif; ?>
                                    </volist>
                                    <li class="dropdown">
                                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                                            <i class="fa fa-th-large"></i> 更多 <b class="caret"></b>
                                        </a>
                                        <ul class="dropdown-menu" role="menu">
                                            <volist name="_menu_list" id="vo" offset="$main_nav_limit-1">
                                                <?php if(!($vo['is_dev'] && !C('DEVELOP_MODE'))): ?>
                                                    <li <?php if($_parent_menu_list[0]['title'] == $vo['title']) echo 'class="active"'; ?>>
                                                        <a href="{:U($vo['_child'][0]['_child'][0]['url'])}" target="<php>echo C(strtolower($vo['name']).'_config.target');</php>">
                                                            <i class="fa {$vo.icon}"></i>
                                                            <span>{$vo.title}</span>
                                                        </a>
                                                    </li>
                                                <?php endif; ?>
                                            </volist>
                                        </ul>
                                    </li>
                                <?php else: ?>
                                    <volist name="_menu_list" id="vo">
                                        <?php if(!($vo['is_dev'] && !C('DEVELOP_MODE'))): ?>
                                            <li <?php if($_parent_menu_list[0]['title'] == $vo['title']) echo 'class="active"'; ?>>
                                                <a href="{:U($vo['_child'][0]['_child'][0]['url'])}" target="<php>echo C(strtolower($vo['name']).'_config.target');</php>">
                                                    <i class="fa {$vo.icon}"></i>
                                                    <span>{$vo.title}</span>
                                                </a>
                                            </li>
                                        <?php endif; ?>
                                    </volist>
                                <?php endif; ?>
                            <?php endif; ?>
                        <?php endif; ?>
                    </ul>
                    <ul class="nav navbar-nav navbar-right">
                        <li>
                            <a href="{:U('Admin/Index/removeRuntime')}" style="border: 0;text-align: left" class="btn ajax-get b-r-0 no-refresh">
                                <i class="fa fa-trash"></i>
                                <span>清空缓存</span>
                            </a>
                        </li>
                        <li>
                            <a target="_blank" href="__ROOT__/"><i class="fa fa-external-link"></i>
                                <span>打开前台</span>
                            </a>
                        </li>
                        <li class="dropdown">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                                <i class="fa fa-user"></i>
                                <span>{$_user_auth.username}</span>
                                <span style="margin-top: -2px;" class="badge badge-danger">{$_SESSION['ly_home_']['new_message']}</span>
                                <b class="caret"></b>
                            </a>
                            <ul class="dropdown-menu" role="menu">
                                <li><a target="_blank" href="__ROOT__/"><i class="fa fa-external-link"></i> 打开前台</a></li>
                                <li>
                                    <a target="_blank" href="{:oc_url('User/Message/index', '', true, true)}">
                                        <i class="fa fa-bell"></i>
                                        <span>我的消息</span>
                                        <span style="margin-top: -2px;" class="badge badge-danger">{$_SESSION['ly_home_']['new_message']}</span>
                                    </a>
                                </li>
                                <li><a href="{:U('Admin/Index/removeRuntime')}" style="border: 0;text-align: left" class="btn ajax-get no-refresh"><i class="fa fa-trash"></i> 清空缓存</a></li>
                                <li><a href="{:U('Admin/Login/logout')}" class="ajax-get"><i class="fa fa-sign-out"></i> 退出</a></li>
                            </ul>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
</block>

<block name="full-container">
    <input type="hidden" name="check_version_url" value="{:U('Admin/Update/checkVersion')}">
    <div class="container-fluid with-top-navbar" style="height: 100%;overflow: hidden;">
        <div class="row" style="height: 100%;">
            <!-- 后台左侧导航 -->
            <?php if (!request()->isMobile()): ?>
                <div id="sidebar" class="col-xs-12 col-sm-3 sidebar tab-content">
                    <?php if (!C('ADMIN_TABS')): ?>
                        <!-- 模块菜单 -->
                        <nav class="navside navside-default" role="navigation">
                            <?php if($_current_menu_list['_child']): ?>
                                <ul class="nav navside-nav navside-first">
                                    <volist name="_current_menu_list._child" id="_ns_first" key="fkey">
                                        <?php if(!($_ns_first['is_dev'] && !C('DEVELOP_MODE'))): ?>
                                            <li>
                                                <a data-toggle="collapse" href="#navside-collapse-{$_ns.id}-{$fkey}">
                                                    <i class="{$_ns_first.icon}"></i>
                                                    <span class="nav-label">{$_ns_first.title}</span>
                                                    <span class="angle fa fa-angle-down"></span>
                                                    <span class="angle-collapse fa fa-angle-left"></span>
                                                </a>
                                                <notempty name="_ns_first._child">
                                                    <ul class="nav navside-nav navside-second collapse in" id="navside-collapse-{$_ns.id}-{$fkey}">
                                                        <volist name="_ns_first._child" id="_ns_second" key="skey">
                                                            <?php if(!($_ns_second['is_dev'] && !C('DEVELOP_MODE'))): ?>
                                                                <li <?php if($_parent_menu_list[2]['id'] == $_ns_second['id']) echo 'class="active"'; ?>>
                                                                    <a href="{:U($_ns_second['url'])}" >
                                                                        <i class="{$_ns_second.icon}"></i>
                                                                        <span class="nav-label">{$_ns_second.title}</span>
                                                                    </a>
                                                                </li>
                                                            <?php endif; ?>
                                                        </volist>
                                                    </ul>
                                                </notempty>
                                            </li>
                                        <?php endif; ?>
                                    </volist>
                                </ul>
                            <?php endif; ?>
                        </nav>
                    <?php endif; ?>
                </div>
            <?php endif; ?>

            <!-- 右侧内容 -->
            <div id="main" class="col-xs-12 col-sm-9 main" style="padding-right: 0;">
                <!-- 面包屑导航 -->
                <ul class="breadcrumb">
                    <li><i class="fa fa-map-marker"></i></li>
                    <li class="text-muted">首页</li>
                </ul>

                <!-- 多标签后台内容部分 -->
                <div class="tab-content ct-tab-content" style="height: 100%;">
                    <!-- 首页 -->
                    <div role="tabpanel" class="tab-pane fade in active" id="home">
                        <div class="dashboard clearfix">
                            <?php if(APP_DEMO && is_login() >= 2): ?>
                                <div class="col-xs-12">
                                    <div class="alert alert-danger">
                                        尊敬的用户您好，您当前处于不可写入的只读模式，如有强烈写入体验需求请联系官方。
                                    </div>
                                </div>
                            <?php endif; ?>

                            <div class="col-xs-12 m-b-sm text-center p-a-0">
                                <div class="col-xs-12 col-sm-3 m-b-sm">
                                    <div style="border:1px solid #ddd;height:92px;">
                                        <div class="pull-left" style="width:40%;height:90px;text-align:center;padding-top:25px;font-size:30px;background: #f8f8f8;">
                                            <i class="fa fa-th-large"></i>
                                        </div>
                                        <div class="pull-left" style="width:60%;height:90px;text-align:center;padding-top:20px;border-left:1px solid #ddd;">
                                            <div style="font-size:22px;">{$index_count['module']}</div>
                                            <div>模块总数</div>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-xs-12 col-sm-3 m-b-sm">
                                    <div style="border:1px solid #ddd;height:92px;">
                                        <div class="pull-left" style="width:40%;height:90px;text-align:center;padding-top:25px;font-size:30px;background: #f8f8f8;">
                                            <i class="fa fa-users"></i>
                                        </div>
                                        <div class="pull-left" style="width:60%;height:90px;text-align:center;padding-top:20px;border-left:1px solid #ddd;">
                                            <div style="font-size:22px;">{$index_count['users']}</div>
                                            <div>用户总数</div>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-xs-12 col-sm-3 m-b-sm">
                                    <div style="border:1px solid #ddd;height:92px;">
                                        <div class="pull-left" style="width:40%;height:90px;text-align:center;padding-top:25px;font-size:30px;background: #f8f8f8;">
                                            <i class="fa fa-user"></i>
                                        </div>
                                        <div class="pull-left" style="width:60%;height:90px;text-align:center;padding-top:20px;border-left:1px solid #ddd;">
                                            <div style="font-size:22px;">{$index_count['today']}</div>
                                            <div>今日新增</div>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-xs-12 col-sm-3 m-b-sm">
                                    <div style="border:1px solid #ddd;height:92px;">
                                        <div class="pull-left" style="width:40%;height:90px;text-align:center;padding-top:25px;font-size:30px;background: #f8f8f8;">
                                            <i class="fa fa-line-chart"></i>
                                        </div>
                                        <div class="pull-left" style="width:60%;height:90px;text-align:center;padding-top:20px;border-left:1px solid #ddd;">
                                            <div style="font-size:22px;">{$index_count['online']}</div>
                                            <div>在线用户(3min内)</div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="col-xs-12 col-sm-6 col-lg-6 ct-update">
                                <div class="panel panel-default">
                                    <div class="panel-heading">
                                        <div class="update pull-right"></div>
                                        <i class="fa fa-cog"></i> 系统信息
                                    </div>
                                    <div class="panel-body">
                                        <table class="table table-condensed">
                                            <tbody>
                                                <tr>
                                                    <td>{:C('PRODUCT_TITLE')}版本</td>
                                                    <td>
                                                        <span class="version">
                                                            v{:C('CURRENT_VERSION')}
                                                            <?php echo C('DEVELOP_VERSION'); ?>
                                                        </span>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>产品型号</td>
                                                    <td>{:C('MODEL_TITLE')}({:C('MODEL_NAME')}) <?php if(C('MODEL_VERSION')) echo 'v'.C('MODEL_VERSION');?></td>
                                                </tr>
                                                <tr>
                                                    <td>官方正版授权</td>
                                                    <td class="sn_info">
                                                        <a href="{:C('WEBSITE_DOMAIN')}" target="_blank" class="btn-danger" style="padding:2px 5px;"><i class="fa fa-lock"></i> 未授权！</a>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>核心框架</td>
                                                    <td>{$Think.VERSION}</td>
                                                </tr>
                                                <tr>
                                                    <td>服务器操作系统</td>
                                                    <td>{$Think.const.PHP_OS}</td>
                                                </tr>
                                                <tr>
                                                    <td>运行环境</td>
                                                    <td>
                                                        <?php
                                                            $server_software = explode(' ', $_SERVER['SERVER_SOFTWARE']);
                                                            echo $server_software[0];
                                                        ?>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>PHP版本</td>
                                                    <td><?php echo PHP_VERSION; ?></td>
                                                </tr>
                                                <tr>
                                                    <td>MYSQL版本</td>
                                                    <td><php>$system_info_mysql = M()->query("select version() as v;");</php>{$system_info_mysql.0.v}</td>
                                                </tr>
                                                <tr>
                                                    <td>上传限制</td>
                                                    <td>{:ini_get('upload_max_filesize')}</td>
                                                </tr>
                                            </tbody>
                                        </table>
                                    </div>
                                </div>
                            </div>

                            <div class="col-xs-12 col-sm-6 col-lg-6">
                                <div class="panel panel-default">
                                    <div class="panel-heading">
                                        <div class="panel-actions"></div>
                                        <i class="fa fa-users"></i> 产品团队
                                    </div>
                                    <div class="panel-body">
                                        <table class="table table-condensed">
                                            <tbody>
                                                <tr>
                                                    <td>网站标题</td>
                                                    <td>{:C('WEB_SITE_TITLE')}</td>
                                                </tr>
                                                <tr>
                                                    <td>运营团队</td>
                                                    <td>{:C('COMPANY_TITLE')}</td>
                                                </tr>
                                                <tr>
                                                    <td>{:C('PRODUCT_TITLE')}框架</td>
                                                    <td><a href="{:C('WEBSITE_DOMAIN')}">{:C('TEAM_TITLE')}</a></td>
                                                </tr>
                                                <tr>
                                                    <td>官方网址</td>
                                                    <td><a href="{:C('WEBSITE_DOMAIN')}">{:C('WEBSITE_DOMAIN')}</a></td>
                                                </tr>
                                                <tr>
                                                    <td>公司地址</td>
                                                    <td>{:C('TEAM_ADDRESS')}</td>
                                                </tr>
                                                <tr>
                                                    <td>核心团队</td>
                                                    <td>{:C('TEAM_MEMBER')}...</td>
                                                </tr>
                                                <tr>
                                                    <td>客服QQ</td>
                                                    <td>{:C('TEAM_QQ')}</td>
                                                </tr>
                                                <tr>
                                                    <td>官方QQ群</td>
                                                    <td>
                                                        <a target="_blank" href="http://shang.qq.com/wpa/qunwpa?idkey=f48f78657bc1f0865ebf44059ca3054b1e73e57c6afee2a91ca3e8d49ee07029">
                                                            <img border="0" src="" alt="零云交流群" title="零云交流群">
                                                        </a>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>联系我们</td>
                                                    <td>
                                                        {:C('TEAM_EMAIL')}
                                                    </td>
                                                </tr>
                                            </tbody>
                                        </table>
                                    </div>
                                </div>
                            </div>

                            <!-- 后台首页小工具 -->
                            {:hook('AdminIndex')}
                        </div>
                    </div>
                </div>

                <div class="clearfix footer hidden-xs">
                    <div class="navbar navbar-default" role="navigation">
                        <div class="container-fluid">
                            <div class="navbar-header">
                                <a class="navbar-brand" target="_blank" href="https://www.lingyun.net">
                                    <span>零云</span>
                                </a>
                            </div>
                            <div class="collapse navbar-collapse navbar-collapse-bottom">
                                <ul class="nav navbar-nav">
                                    <li>
                                        <a href="{:C('WEBSITE_DOMAIN')}" class="text-muted" target="_blank">
                                            <span>版权所有 © 2014-<php>echo date("Y",time());</php></span>
                                        </a>
                                    </li>
                                </ul>
                                <ul class="nav navbar-nav navbar-right">
                                    <li><a target="_blank" href="https://www.lingyun.net" class="text-muted pull-right">Powered By 零云</a></li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</block>
